package com.xl.dispatch_sdk_server.system;

import com.google.common.collect.Lists;
import com.xl.adminserver.beans.RestApiResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {

    @RequestMapping("list")
    public List<String> getList(@RequestParam("pileNo") String pileNo) {
        System.out.println("桩号：" + pileNo);
        return Lists.newArrayList("111", "222");
    }

    @RequestMapping("postBodyTest")
    public RestApiResult callPost(@RequestBody Map<String, Object> params) {
        System.out.println(params);
        params.put("status", "success");
        params.put("date", new Date());
        return  new RestApiResult(params);
    }

}
